<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>货物列表 - 仓储管理系统</title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <meta name="keywords" content="仓储管理HTML模板">
    <meta name="description" content="仓储管理是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
    <meta name="author" content="andong">
    <link href="light/css/bootstrap.min.css" th:href="@{/light/css/bootstrap.min.css}"  rel="stylesheet">
    <link href="light/css/materialdesignicons.min.css" th:href="@{/light/css/materialdesignicons.min.css}" rel="stylesheet">
    <link href="light/css/style.min.css" th:href="@{/light/css/style.min.css}" rel="stylesheet">
    <style type="text/css">
        table{
            text-align: center;
        }
        th{
            text-align: center;
        }
        #page{
            margin-left: 500px;
        }
    </style>
</head>
<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <div th:replace="commons/bar::sidebar(activeUri='goods')"></div>
        <!--End 左侧导航-->

        <!--头部信息-->
        <header class="lyear-layout-header">

            <nav class="navbar navbar-default">
                <div class="topbar">
                    <div class="topbar-left">
                        <div class="lyear-aside-toggler">
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                        </div>
                        <span class="navbar-page-title"> 货物管理 </span>
                    </div>
                    <div th:replace="commons/bar::header"></div>
                </div>
            </nav>
        </header>
        <!--End 头部信息-->
        <!--页面主要内容-->
        <main class="lyear-layout-content">

            <div class="container-fluid">

                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-toolbar clearfix">
                                <form class="pull-right search-bar" method="get" action="#!" role="form">
                                    <div class="input-group">
                                        <div class="input-group-btn">
                                            <input type="hidden" name="search_field" id="search-field" value="title">
                                            <button class="btn btn-default dropdown-toggle" id="search-btn" data-toggle="dropdown" type="button" aria-haspopup="true" aria-expanded="false">
                                                搜索 <span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu">
                                                <li> <a tabindex="-1" href="javascript:void(0)" data-field="title">货物ID</a> </li>
                                                <li> <a tabindex="-1" href="javascript:void(0)" data-field="cat_name">货物名称</a> </li>
                                            </ul>
                                        </div>
                                        <input type="text" class="form-control" value="" name="keyword" placeholder="请输入">
                                    </div>
                                </form>
                                <div class="toolbar-btn-action">
                                    <a class="btn btn-primary m-r-5" href="#!" th:href="@{/good}"><i class="mdi mdi-plus"></i> 新增</a>
                                    <a class="btn btn-success m-r-5" href="#!"><i class="mdi mdi-check"></i> 启用</a>
                                    <a class="btn btn-warning m-r-5" href="#!"><i class="mdi mdi-block-helper"></i> 禁用</a>
                                    <a class="btn btn-danger" href="#!"><i class="mdi mdi-window-close"></i> 删除</a>
                                </div>
                            </div>
                            <div class="card-body">

                                <div class="table-responsive">
                                    <table class="table table-bordered">
                                        <thead>
                                        <tr>
                                            <th>
                                                <label class="lyear-checkbox checkbox-primary">
                                                    <input type="checkbox" id="check-all"><span></span>
                                                </label>
                                            </th>
                                            <th>货物ID</th>
                                            <th>货物简码</th>
                                            <th>货物名称</th>
                                            <th>货物计量</th>
                                            <th>货物库存</th>
                                            <th>所在仓库</th>
                                            <!--<th>阅读量</th>
                                            <th>状态</th>-->
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr th:each="good:${goods}">
                                            <td>
                                                <label class="lyear-checkbox checkbox-primary">
                                                    <input type="checkbox" name="ids[]" value="1"><span></span>
                                                </label>
                                            </td>
                                            <td th:text="${good.gid}"></td>
                                            <td th:text="${good.gsmall}"></td>
                                            <td th:text="${good.gname}"></td>
                                            <td th:text="${good.gunit}"></td>
                                            <td th:text="${good.gsun}"></td>
                                            <td th:text="${good.store.sname}"></td>
                                            <!--<td>36</td>
                                            <td><font class="text-success">正常</font></td>-->
                                            <td>
                                                <div class="btn-group">
                                                    <a class="btn btn-xs btn-default" href="#!" th:href="@{/good/upd/}+${good.gid}" title="编辑" data-toggle="tooltip"><i class="mdi mdi-pencil"></i></a>
                                                    <button th:attr="del_url=@{/good/del/}+${good.gid}" class="btn btn-xs btn-default deleteBtn" title="删除" data-toggle="tooltip"><i class="mdi mdi-window-close"></i></button>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <!--分页 -->
                                <div id="page">
                                    <ul class="pagination">
                                        <li class="disabled"><span>«</span></li>
                                        <li class="active"><span>1</span></li>
                                        <li><a href="#1">2</a></li>
                                        <li><a href="#1">3</a></li>
                                        <li class="disabled"><span>...</span></li>
                                        <li><a href="#!">10</a></li>
                                        <li><a href="#!">12</a></li>
                                        <li><a href="#!">»</a></li>
                                    </ul>
                                </div>
                                <!--END分页结束 -->

                            </div>
                        </div>
                    </div>

                </div>

            </div>

        </main>
        <!--End 页面主要内容-->
        <form id="deleteForm"  method="post">
            <input type="hidden" name="_method" value="DELETE"/>
        </form>
    </div>
</div>
<script type="text/javascript" src="light/js/jquery.min.js" th:src="@{/light/js/jquery.min.js}"></script>
<script type="text/javascript" src="light/js/bootstrap.min.js" th:src="@{/light/js/bootstrap.min.js}"></script>
<script type="text/javascript" src="light/js/perfect-scrollbar.min.js" th:src="@{/light/js/perfect-scrollbar.min.js}"></script>
<script type="text/javascript" src="light/js/main.min.js" th:src="@{/light/js/main.min.js}"></script>
<script>
    $(".deleteBtn").click(function () {
        //删除当前货物
        $("#deleteForm").attr("action", $(this).attr("del_url")).submit();
        return false;
    });
</script>
</body>
</html>